# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pyaml
pkgver=21.10.1
pkgrel=2
pkgdesc="PyYAML-based module to produce pretty and readable YAML-serialized data"
url="https://pypi.python.org/pypi/pyaml"
license=('BSD')
arch=('any')
depends=('python-yaml')
makedepends=('python-setuptools' 'python-yaml')
checkdepends=('python-unidecode')
optdepends=('python-unidecode: Needed if same-id objects or recursion is used within serialized data')
source=("https://pypi.io/packages/source/p/pyaml/pyaml-$pkgver.tar.gz")
sha512sums=('3a98a021856446584f079bfb7427c63feaf6fdd1bd0d809d46aa0c646b2cb9533c393ed0167240be587aad7b94209b6e5bfe2c09918b45ec9a86ad9781bdf9f2')

build() {
  cd "$srcdir"/pyaml-$pkgver
  python setup.py build
}

check() {
  cd "$srcdir"/pyaml-$pkgver
  python setup.py test
}

package() {
  cd pyaml-$pkgver
  python3 setup.py install --root="$pkgdir" --optimize=1
  install -D -m644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
